//
//  UITextViewExtension.swift
//  Jock
//
//  Created by HD on 15/3/24.
//  Copyright (c) 2015年 Haidy. All rights reserved.
//

import UIKit

protocol UITextViewTextLineProtocol {
    var textLine: Int { get }
}

extension UITextView: UITextViewTextLineProtocol {
    
    var textLine: Int {
        
        get {
            var size = (self.text as NSString).sizeWithAttributes([NSFontAttributeName : self.font])
            return Int(self.contentSize.height / size.height)
        }
    }
}